﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace WEB_MechSysWeb
{
    public class Mensagem
    {

        public static void Exibir(string mensagem)
        {
            try
            {
                string script = string.Format("<script type=\"text/javascript\">alert('{0}');</script>", mensagem);

                Page page = HttpContext.Current.CurrentHandler as Page;
                page.ClientScript.RegisterStartupScript(typeof(Page), "alert", script);
            }
            catch (Exception)
            {

            }
        }

        public Mensagem()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static void ExibirEmUP(string mensagem)
        {
            Page pg = (Page)HttpContext.Current.Handler;
            ScriptManager.RegisterStartupScript(pg, pg.GetType(), Guid.NewGuid().ToString(), "alert('" + mensagem + "');", true);
        }

        public static void ExibirSemUP(string mensagem)
        {
            Page pg = (Page)HttpContext.Current.Handler;
            pg.ClientScript.RegisterStartupScript(pg.GetType(), Guid.NewGuid().ToString(), "alert('" + mensagem + "');", true);
        }



    }
}
